package cn.appsys.service.impl;

import cn.appsys.dao.appInfoDao.AppInfoMapper;
import cn.appsys.dao.appVersionDao.AppVersionMapper;
import cn.appsys.pojo.AppVersion;
import cn.appsys.service.AppVersionService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service("AppVersionService")
public class AppVersionServiceImpl implements AppVersionService {

    @Resource
    private AppVersionMapper appVersionMapper;

    @Override
    public boolean modify(AppVersion appVersion) throws Exception {
        boolean flag = false;
        if(appVersionMapper.modify(appVersion) > 0){
            flag = true;
        }
        return flag;
    }

    @Override
    public AppVersion getAppVersionById(Integer id) throws Exception {
        return appVersionMapper.getAppVersionById(id);
    }

    @Override
    public List<AppVersion> getAppVersionList(Integer appId) throws Exception {
        return appVersionMapper.getAppVersionList(appId);
    }

    @Override
    public boolean deleteApkFile(Integer id) throws Exception {
        boolean flag = false;
        if(appVersionMapper.deleteApkFile(id) > 0){
            flag = true;
        }
        return flag;
    }


    @Resource
    private AppInfoMapper appInfoMapper;

    }


